package com.wn.dead;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author yellow Docter
 * @date 2023 -07-25
 * @desc
 *   测试 死信队列
 */
@Component
public class DeadProduct {

    @Autowired
    private RabbitTemplate rabbitTemplate;


    public void send(String msg){

        /**
         *  参数1:  交换机
         *  参数2:  路由
         *  参数3:  消息
         */
        rabbitTemplate.convertAndSend(
                "exchange-normal",
                "zs",
                msg
        );

    }

}
